package org.example.sensor.controller;

import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.example.sensor.dox.User;
import org.example.sensor.service.UserService;
import org.example.sensor.vo.ResultVO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/register/")
@RequiredArgsConstructor
public class RegisterController {
    private final UserService userService;
    //添加user
    @Operation(summary = "添加user",description = "只需输入账号,密码即可")
    @PostMapping("user")
    public ResultVO postUser(@RequestBody User user) {
        userService.addUserByRe(user);
        return ResultVO.ok();
    }
}
